/**
 * Created with IntelliJ IDEA.
 * User: aermakov
 * Date: 24.05.13
 * Time: 13:17
 * To change this template use File | Settings | File Templates.
 */

Ext.ns('GrailsCompany.form');

GrailsCompany.form.EmployeeFinancialForm = Ext.extend(GrailsCompany.form.CRUDFormPanel, {
    constructor: function (config) {
        config = Ext.apply({
            items: [
                {
                    xtype: 'hidden',
                    name: 'id',
                    width: 150
                },
                {
                    fieldLabel: 'VAT ID',
                    name: 'vatId',
                    width: 150,
                    validator: function (value) {
                        return GrailsCompany.util.RegexValidator(value, /^\d{12}$/, 'Must be 12 digits long');
                    }
                },
                {
                    fieldLabel: 'Card Number',
                    name: 'cardNumber',
                    width: 150,
                    validator: GrailsCompany.util.CreditCardValidator
                }
            ]
        }, config);

        GrailsCompany.form.EmployeeFinancialForm.superclass.constructor.call(this, config);
    }
});
Ext.reg('employeefinform', GrailsCompany.form.EmployeeFinancialForm);
